package cn.gdchent.nativehotfix.app

import android.app.Application
import android.content.Context
import android.content.Intent
import android.support.multidex.MultiDex
import cn.gdchent.nativehotfix.tinker.manager.TinkerManager
import com.tencent.tinker.anno.DefaultLifeCycle
import com.tencent.tinker.loader.app.ApplicationLike
import com.tencent.tinker.loader.shareutil.ShareConstants


@DefaultLifeCycle(
    application = ".MyTinkerApplication",
    flags = ShareConstants.TINKER_ENABLE_ALL,
    loadVerifyFlag = false
)
class GdchentApplicationLike:ApplicationLike{
    constructor(
        application: Application?,
        tinkerFlags: Int,
        tinkerLoadVerifyFlag: Boolean,
        applicationStartElapsedTime: Long,
        applicationStartMillisTime: Long,
        tinkerResultIntent: Intent?
    ) : super(
        application,
        tinkerFlags,
        tinkerLoadVerifyFlag,
        applicationStartElapsedTime,
        applicationStartMillisTime,
        tinkerResultIntent
    )

    override fun onBaseContextAttached(base: Context?) {
        super.onBaseContextAttached(base)
        MultiDex.install(base)
        TinkerManager.installTinker(this)
    }
}